package com.boot.security.server.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.boot.security.server.model.BxbBrxx;

@Mapper
public interface BxbBrxxDao {

    @Select("select * from bxb_brxx t where t.id = #{id}")
    BxbBrxx getById(Long id);

    @Delete("delete from bxb_brxx where id = #{id}")
    int delete(Long id);

    int update(BxbBrxx bxbBrxx);
    
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into bxb_brxx(brxxid, mzh, ybbh, dcrq, zdyy, zzys, dcy, A1name, A2jg, lxdh, xzzsheng, xxzshi, xzzxian, cqjzsheng, ccjzshi, ccjzxian, cqjzdym, csrq, xb, sg, tz, whcd, hyzk, zy, lrrq, createtime, updatetime, delflag, remarks) values(#{brxxid}, #{mzh}, #{ybbh}, #{dcrq}, #{zdyy}, #{zzys}, #{dcy}, #{A1name}, #{A2jg}, #{lxdh}, #{xzzsheng}, #{xxzshi}, #{xzzxian}, #{cqjzsheng}, #{ccjzshi}, #{ccjzxian}, #{cqjzdym}, #{csrq}, #{xb}, #{sg}, #{tz}, #{whcd}, #{hyzk}, #{zy}, #{lrrq}, #{createtime}, #{updatetime}, #{delflag}, #{remarks})")
    int save(BxbBrxx bxbBrxx);
    
    int count(@Param("params") Map<String, Object> params);

    List<BxbBrxx> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
}
